import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.Toolkit;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.QuadCurve2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class Bild2 extends JPanel implements Runnable {

	public BufferedImage bi;
	private Thread t;

	public Bild2() {
		super();

		this.setBackground(Color.WHITE);
		this.setDoubleBuffered(true);

		try {
			bi = ImageIO.read(new File("blume.jpg"));
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	public void addNotify() {
		super.addNotify();

		t = new Thread(this);
		t.start();
	}

	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		
		Graphics2D g2d = (Graphics2D) g;
		g2d.drawImage(bi, 0, bi.getHeight(), null);

	}

	@Override
	public void run() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		JFrame f = new JFrame("Bild");
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setSize(400, 400*2);
		f.add(new Bild2());
		f.setVisible(true);

	}

}
